package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.HotSetmeal;
import com.itheima.pojo.Order;
import com.itheima.pojo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderMapper {
    Page<OrderVO> pageQuery(String queryString);

    void updateOrder(Order order);
@Select("SELECT *from health_chuanzhi.t_order")
    List<Order> getAll();
@Select("SELECT count(*) from health_chuanzhi.t_order where orderDate=#{date}")
    Integer getCountByDate(Date date);
@Select("SELECT count(*) from health_chuanzhi.t_order where orderDate>=#{monthBeginStr}")
    Integer getCountByMonth(String monthBeginStr);
@Select("SELECT  count(*) from health_chuanzhi.t_order where orderDate>=#{weekBeginStr}")
    Integer getCountByWeek(String weekBeginStr);
@Select("SELECT count(*) from health_chuanzhi.t_order where orderDate=#{date} and orderStatus=#{str}")
    Integer getVisitsCountByDate(Date date, String str);
@Select("SELECT count(*) from health_chuanzhi.t_order where orderDate>=#{monthBeginStr} and orderStatus=#{str}")
    Integer getVisitsCountByMonth(String monthBeginStr, String str);
    @Select("SELECT count(*) from health_chuanzhi.t_order where orderDate>=#{weekBeginStr} and orderStatus=#{str}")
    Integer getVisitsCountByWeek(String weekBeginStr, String str);

    List<HotSetmeal> getHotSetmeals();
}
